package com.xuetang9.t9.xinhuaxia.beans;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.multipart.MultipartFile;

import java.io.File;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.*;

@Table(name = "user")
public class User implements Serializable{
    /**
     * 用户ID
     */
    @Id
    @Column(name = "u_userId")
    private Long uUserid;

    private List<ReceiveAddress> receiveAddressList;
    /**
     * 用户名
     */
    @Column(name = "u_userName")
    private String uUsername;

    /**
     * 密码
     */
    @Column(name = "u_password")
    private String uPassword;

    /**
     * 性别
     */
    @Column(name = "u_sex")
    private String uSex;

    /**
     * 真实姓名
     */
    @Column(name = "u_realName")
    private String uRealname;

    /**
     * 用户生日
     */
    @Column(name = "u_birthday")
    private Date uBirthday;

    /**
     * 邮箱
     */
    @Column(name = "u_email")
    private String uEmail;

    /**
     * 城市
     */
    @Column(name = "u_city")
    private String uCity;

    /**
     * 地址
     */
    @Column(name = "u_address")
    private String uAddress;

    /**
     * 电话
     */
    @Column(name = "u_phone")
    private String uPhone;

    /**
     * 注册时间
     */
    @Column(name = "u_createDate")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date uCreatedate;
    /**
     * 文件
     */
    private MultipartFile userHeaderPic;
    /**
     * 用户头像路径
     */
    @Column(name = "u_imgPath")
    private String uImgpath;

    public List<ReceiveAddress> getReceiveAddressList() {
        return receiveAddressList;
    }

    public void setReceiveAddressList(List<ReceiveAddress> receiveAddressList) {
        this.receiveAddressList = receiveAddressList;
    }

    @Override
    public String toString() {
        return "User{" +
                "uUserid=" + uUserid +
                ", receiveAddressList=" + receiveAddressList +
                ", uUsername='" + uUsername + '\'' +
                ", uPassword='" + uPassword + '\'' +
                ", uSex='" + uSex + '\'' +
                ", uRealname='" + uRealname + '\'' +
                ", uBirthday=" + uBirthday +
                ", uEmail='" + uEmail + '\'' +
                ", uCity='" + uCity + '\'' +
                ", uAddress='" + uAddress + '\'' +
                ", uPhone='" + uPhone + '\'' +
                ", uCreatedate=" + uCreatedate +
                ", userHeaderPic=" + userHeaderPic +
                ", uImgpath='" + uImgpath + '\'' +
                '}';
    }

    public MultipartFile getUserHeaderPic() {
        return userHeaderPic;
    }

    public void setUserHeaderPic(MultipartFile userHeaderPic) {
        this.userHeaderPic = userHeaderPic;
    }

    /**
     * 获取用户ID
     *
     * @return u_userId - 用户ID
     */
    public Long getuUserid() {
        return uUserid;
    }

    /**
     * 设置用户ID
     *
     * @param uUserid 用户ID
     */
    public void setuUserid(Long uUserid) {
        this.uUserid = uUserid;
    }

    /**
     * 获取用户名
     *
     * @return u_userName - 用户名
     */
    public String getuUsername() {
        return uUsername;
    }

    /**
     * 设置用户名
     *
     * @param uUsername 用户名
     */
    public void setuUsername(String uUsername) {
        this.uUsername = uUsername;
    }

    /**
     * 获取密码
     *
     * @return u_password - 密码
     */
    public String getuPassword() {
        return uPassword;
    }

    /**
     * 设置密码
     *
     * @param uPassword 密码
     */
    public void setuPassword(String uPassword) {
        this.uPassword = uPassword;
    }

    /**
     * 获取性别
     *
     * @return u_sex - 性别
     */
    public String getuSex() {
        return uSex;
    }

    /**
     * 设置性别
     *
     * @param uSex 性别
     */
    public void setuSex(String uSex) {
        this.uSex = uSex;
    }

    /**
     * 获取真实姓名
     *
     * @return u_realName - 真实姓名
     */
    public String getuRealname() {
        return uRealname;
    }

    /**
     * 设置真实姓名
     *
     * @param uRealname 真实姓名
     */
    public void setuRealname(String uRealname) {
        this.uRealname = uRealname;
    }

    /**
     * 获取用户生日
     *
     * @return u_birthday - 用户生日
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    public Date getuBirthday() {
        return uBirthday;
    }

    /**
     * 设置用户生日
     *
     * @param uBirthday 用户生日
     */
    public void setuBirthday(Date uBirthday) {
        this.uBirthday = uBirthday;
    }

    /**
     * 获取邮箱
     *
     * @return u_email - 邮箱
     */
    public String getuEmail() {
        return uEmail;
    }

    /**
     * 设置邮箱
     *
     * @param uEmail 邮箱
     */
    public void setuEmail(String uEmail) {
        this.uEmail = uEmail;
    }

    /**
     * 获取城市
     *
     * @return u_city - 城市
     */
    public String getuCity() {
        return uCity;
    }

    /**
     * 设置城市
     *
     * @param uCity 城市
     */
    public void setuCity(String uCity) {
        this.uCity = uCity;
    }

    /**
     * 获取地址
     *
     * @return u_address - 地址
     */
    public String getuAddress() {
        return uAddress;
    }

    /**
     * 设置地址
     *
     * @param uAddress 地址
     */
    public void setuAddress(String uAddress) {
        this.uAddress = uAddress;
    }

    /**
     * 获取电话
     *
     * @return u_phone - 电话
     */
    public String getuPhone() {
        return uPhone;
    }

    /**
     * 设置电话
     *
     * @param uPhone 电话
     */
    public void setuPhone(String uPhone) {
        this.uPhone = uPhone;
    }

    /**
     * 获取注册时间
     *
     * @return u_createDate - 注册时间
     */
    public Date getuCreatedate() {
        return uCreatedate;
    }

    /**
     * 设置注册时间
     *
     * @param uCreatedate 注册时间
     */
    public void setuCreatedate(Date uCreatedate) {
        this.uCreatedate = uCreatedate;
    }

    /**
     * 获取用户头像路径
     *
     * @return u_imgPath - 用户头像路径
     */
    public String getuImgpath() {
        return uImgpath;
    }

    /**
     * 设置用户头像路径
     *
     * @param uImgpath 用户头像路径
     */
    public void setuImgpath(String uImgpath) {
        this.uImgpath = uImgpath;
    }

}